/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.wisnu.ebs.view;

import java.awt.Cursor;

/**
 *
 * @author Wisnu Wardoyo <mas.wisnu99@gmail.com>
 */
public class HelpPanel extends javax.swing.JPanel {

    String[][] contents;

    public HelpPanel() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        jScrollPane1 = new javax.swing.JScrollPane();
        textPane = new javax.swing.JTextPane();
        labJudul = new javax.swing.JLabel();

        setBackground(new java.awt.Color(153, 255, 255));
        setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jList1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jList1.setForeground(new java.awt.Color(0, 51, 51));
        jList1.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Membuat Dokumen", "Membuka Dokumen", "Konfigurasi Dokumen", "Menganalisis Dokumen", "Mencetak Dokumen", "Cetak Bentuk Lain" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jList1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jList1MouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(jList1);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 195, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(229, Short.MAX_VALUE))
        );

        textPane.setEditable(false);
        textPane.setContentType("text/html"); // NOI18N
        textPane.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
        textPane.setText("<html>\r\n  <head>\r\n\r\n  </head>\r\n  <body>\r\n    <p style=\"margin-top: 0;text-align:justify\">\r\n    PROGRAM ANALISIS BUTIR SOAL PILIHAN GANDA\n<br><br>\nAnda dapat melakukan analisis butir soal pilihan ganda secara cepat dan mudah. Analisis terhadap butir soal meliputi aspek Tingkat Kesukaran, Daya Beda, Keefektifan Pengecoh, dan Homogenitas butir. Program juga menganalisis realibilitas tes secara keseluruhan.\n\n<br><br>\nHasil analisis ditampilkan dengan cepat, mudah dengan tampilan yang menarik. Anda dapat membuat atau membuka dokumen serta mencetak hasil analisis ataupun mengubah hasil analisis kebentuk dokumen lain.\n\n<br><br>\nUntuk panduan penggunaan program silahkan klik menu disamping.\n    </p>\r\n  </body>\r\n</html>\r\n");
        textPane.setMaximumSize(new java.awt.Dimension(494, 46));
        textPane.setPreferredSize(new java.awt.Dimension(494, 46));
        jScrollPane1.setViewportView(textPane);

        labJudul.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        labJudul.setForeground(new java.awt.Color(0, 51, 51));
        labJudul.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        labJudul.setText("PUSAT BANTUAN");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane1)
                    .addComponent(labJudul, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(labJudul, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1)))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jList1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jList1MouseClicked
        try {
            this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            String SelectedItem = String.valueOf(jList1.getSelectedIndex());
            String htmlTagOpen = "<html> <head> </head> <body><p style='margin-top: 0;text-align:justify'>";
            String htmlTagClose = "</p></body></html>";
            textPane.setText(htmlTagOpen + contents[jList1.getSelectedIndex()][1] + htmlTagClose);
        } finally {
            this.setCursor(Cursor.getDefaultCursor());
        }


    }//GEN-LAST:event_jList1MouseClicked


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JList jList1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel labJudul;
    private javax.swing.JTextPane textPane;
    // End of variables declaration//GEN-END:variables

    public void setContents(String[][] content) {
        this.contents = content;
    }

    public String[][] getContents() {
        return this.contents;
    }

}
